<!--

                                   .. .vr
                                 qBMBBBMBMY
                                8BBBBBOBMBMv
                              iMBMM5vOY:BMBBv
              .r,             OBM;   .: rBBBBBY
              vUL             7BB   .;7. LBMMBBM.
             .@Wwz.           :uvir .i:.iLMOMOBM..
              vv::r;             iY. ...rv,@arqiao.
               Li. i:             v:.::::7vOBBMBL..
               ,i7: vSUi,         :M7.:.,:u08OP. .
                 .N2k5u1ju7,..     BMGiiL7   ,i,i.
                  :rLjFYjvjLY7r::.  ;v  vr... rE8q;.:,,
                 751jSLXPFu5uU@guohezou.,1vjY2E8@Yizero.
                 BB:FMu rkM8Eq0PFjF15FZ0Xu15F25uuLuu25Gi.
               ivSvvXL    :v58ZOGZXF2UUkFSFkU1u125uUJUUZ,
             :@kevensun.      ,iY20GOXSUXkSuS2F5XXkUX5SEv.
         .:i0BMBMBBOOBMUi;,        ,;8PkFP5NkPXkFqPEqqkZu.
       .rqMqBBMOMMBMBBBM .           @kexianli.S11kFSU5q5
     .7BBOi1L1MM8BBBOMBB..,          8kqS52XkkU1Uqkk1kUEJ
     .;MBZ;iiMBMBMMOBBBu ,           1OkS1F1X5kPP112F51kU
       .rPY  OMBMBBBMBB2 ,.          rME5SSSFk1XPqFNkSUPZ,.
              ;;JuBML::r:.:.,,        SZPX0SXSP5kXGNP15UBr.
                  L,    :@huhao.      :MNZqNXqSqXk2E0PSXPE .
              viLBX.,,v8Bj. i:r7:,     2Zkqq0XXSNN0NOXXSXOU
            :r2. rMBGBMGi .7Y, 1i::i   vO0PMNNSXXEqP@Secbone.
            .i1r. .jkY,    vE. iY....  20Fq0q5X5F1S2F22uuv1M;

-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
	<meta name="description" content="">
	<meta name="author" content="">
	<link rel="icon" href="../../favicon.ico">

	<title>AD System</title>

	<!-- Bootstrap core CSS -->
	<link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
	<!--<link href="../scripts/css/bootstrap.css" rel="stylesheet">-->

	<!-- Custom styles for this template -->
	<link href="../scripts/css/navbar.css" rel="stylesheet">
	<link href="../scripts/css/dashboard.css" rel="stylesheet">

	<!--jQuery Bootgrid -->
	<!--<link href="//cdnjs.cloudflare.com/ajax/libs/jquery-bootgrid/1.2.0/jquery.bootgrid.css" rel="stylesheet">-->
	<link href="../scripts/css/jquery.bootgrid.css" rel="stylesheet">

	<!--Multi Select-->
	<link href="../scripts/css/bootstrap-multiselect.css" rel="stylesheet">

	<!--PNotify-->
	<link href="../scripts/css/pnotify.custom.min.css" rel="stylesheet">

	<!--formValidation-->
	<link href="../scripts/css/formValidation.min.css" rel="stylesheet">

	<!--Code Prettify-->
	<link href="../scripts/css/prettify.css" rel="stylesheet">

	<!--Custom Css-->
	<link href="../scripts/css/application.css" rel="stylesheet">

	<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
	<!--[if lt IE 9]>
	<script src="../scripts/js/ie8-responsive-file-warning.js"></script><![endif]-->
	<script src="../scripts/js/ie-emulation-modes-warning.js"></script>

	<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
	<!--[if lt IE 9]>
	<script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
	<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->

</head>

<body>

<!--Component-->

<div class="modal fade" id="add-repo-modal" tabindex="-1" role="dialog" aria-labelledby="add-repo-modal-label">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="add-repo-modal-label">Add New Git Repository</h4>
			</div>
			<div class="modal-body">
				<form id="add-repo-form">
					<div class="form-group">
						<label for="repo_name" class="control-label">Repo Name:</label>
						<input type="text" name="repo_name" class="form-control" id="repo_name">
					</div>
					<div class="form-group">
						<label for="repo_url" class="control-label">Git URL:</label>
						<input type="text" name="repo_url" class="form-control" id="repo_url">
					</div>
					<div class="form-group">
						<label for="repo_builder_config_dir" class="control-label">Builder File Path:</label>
						<input type="text" name="repo_builder_config_dir" class="form-control" id="repo_builder_config_dir">
					</div>
					<div class="form-group">
						<label for="repo_username" class="control-label">Git UserName:</label>
						<input type="text" name="repo_username" class="form-control" id="repo_username">
					</div>
					<div class="form-group">
						<label for="repo_password" class="control-label">Git Password:</label>
						<input type="text" name="repo_password" class="form-control" id="repo_password">
					</div>

					<div class="form-group">
						<label for="message_text" class="control-label">Description:</label>
						<textarea name="message_text" class="form-control" id="message_text"></textarea>
					</div>
					<button id="repo-add-btn" type="submit" class="btn btn-primary">Submit</button>
				</form>
			</div>
			<div class="modal-footer">
				<!--<button type="button" class="btn btn-primary" onclick="onclick_repo_add()">Comfirm</button>-->
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
			</div>
		</div>
	</div>
</div>

<!--End Of Component-->

<div class="container">

	<!-- Static navbar -->
	<nav class="navbar navbar-default navbar-fixed-top">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
				        aria-expanded="false" aria-controls="navbar">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">Auto Deployment System</a>
			</div>
			<div id="navbar" class="navbar-collapse collapse">
				<ul class="nav navbar-nav">
					<li class="active"><a href="#">DashBoard</a></li>
					<li><a href="#">About</a></li>
					<li><a href="#">Contact</a></li>
				</ul>
				<ul class="nav navbar-nav navbar-right">
					<li class="dropdown">
						<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
						   aria-expanded="false">Select Repository<span class="caret"></span></a>
						<ul id="repository_dropdown_list" class="dropdown-menu">
							<li><a data-toggle="modal" href="#add-repo-modal">Add Repo</a></li>
							<li role="separator" class="divider"></li>
							<li class="dropdown-header">Repository List</li>
						</ul>
					</li>
				</ul>
			</div>
			<!--/.nav-collapse -->
		</div>
		<!--/.container-fluid -->
	</nav>

	<div class="container-fluid">
		<div class="row">
			<div class="col-sm-3 col-md-2 sidebar">

				<ul class="nav nav-sidebar">
					<li class="active"><a href="#git_log_anchor">Git Repository Log</a></li>
					<li><a href="#cluster_anchor">Cluster Server Config</a></li>
					<li><a href="#build_config_file_demo">Build Config File Demo</a></li>
				</ul>

			</div>
			<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

				<h1 id="git_log_anchor" class="page-header">Git Repository Log
					<small></small>
				</h1>
				<p>
					INFO&nbsp;:&nbsp;&nbsp;Pick a commit to see its commit detail or depoly to servers!
				</p>

				<table id="git-grid" class="table table-condensed table-hover table-striped">
					<thead>
					<tr>
						<!--<th data-column-id="id" data-type="numeric">ID</th>-->
						<!--<th data-column-id="sender">Sender</th>-->
						<!--<th data-column-id="received" data-order="desc">Received</th>-->
						<!--<th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th>-->

						<th data-column-id="c_id" data-sortable="false">Commit ID</th>
						<th data-column-id="msg" data-sortable="false">Message</th>
						<th data-column-id="author" data-sortable="false">Author</th>
						<th data-column-id="c_date" data-sortable="false">Commit Date</th>
						<th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th>

					</tr>
					</thead>
				</table>

				<h1 id="cluster_anchor" class="page-header">Cluster Server Config
					<button title="Add" type="button" onclick="onclickClusterAdd();" class="btn btn-xs btn-default glyphicon glyphicon-plus"></button>
				</h1>
				<p>
					INFO&nbsp;:&nbsp;&nbsp;AD System uses sftp to deploy your project files and shell script to controll server status,
					it means AD currently only support for Linux servers, if you have installed  third-party sftp server
					on you Windows servers, it should also works fine.
				</p>
				<table id="cluster-grid" class="table table-condensed table-hover table-striped">
					<thead>
					<tr>
						<!--<th data-column-id="id" data-type="numeric">ID</th>-->
						<!--<th data-column-id="sender">Sender</th>-->
						<!--<th data-column-id="received" data-order="desc">Received</th>-->
						<!--<th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th>-->

						<th data-column-id="Name" data-sortable="false">Name</th>
						<th data-column-id="Last Deployment Revision" data-sortable="false">Last Deployment Revision</th>
						<th data-column-id="Last Deployment At" data-sortable="false">Last Deployment At</th>
						<th data-column-id="IP" data-sortable="false">IP</th>
						<th data-column-id="PORT" data-sortable="false">SSH Port</th>
						<th data-column-id="Deploy Dir" data-sortable="false">Deploy Dir</th>
						<th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th>

					</tr>
					</thead>
				</table>

				<h1 id="build_config_file_demo" class="page-header">Build Config File Demo</h1>
					<h4>Cautious:</h4>
					<p>1)&nbsp;&nbsp;&nbsp;AD System uses Ant to do the compile job, so a 'build.xml' file is required in your project. </p>
					<p>2)&nbsp;&nbsp;&nbsp;As the following sample shows,
						you can config your compile target as a normal ant target,
						but the deploy target needs to be like this, and it must be set as default target.
					</p>
					<p>3)&nbsp;&nbsp;&nbsp;Deploy target consist of several scp tag, AD System will set necessary properties
						depend on the target server you select to deploy, So following property names are fixed:
						<code>server.ip</code>
						<code>server.port</code>
						<code>server.username</code>
						<code>server.password</code>
						<code>server.deploydir</code></br>

						AD system will set there properties for you automaticlly.
					</p>
				<code>build.xml:</code>
				<pre>

					<xmp class="prettyprint lang-xml">
<?xml version="1.0" encoding="UTF-8" ?>
<project name ="AD System" default ="deploy" basedir =".">

	<property file="build.properties" />

	<target name ="init">
		<mkdir dir ="${build.dir}"/>
		<mkdir dir ="${classes.dir}"/>
		<mkdir dir ="${dist.dir}"/>
	</target>

	<target name ="clean">
		<delete dir ="${build.dir}"/>
		<delete dir ="${classes.dir}"/>
		<delete dir ="${dist.dir}"/>
	</target>

	<path id="compile.classpath">
		<fileset dir="${web.lib}">
			<include name="*.jar"/>
		</fileset>
		<fileset dir="${basedir}/lib">
			<include name="*.jar"/>
		</fileset>
	</path>

	<target name ="compile" depends="init">
		<copy todir ="${classes.dir}">
			<fileset dir="${basedir}/src/config"/>
			<fileset dir="${basedir}/src/java" excludes="**/*.java"/>
		</copy>
		<javac srcdir ="${basedir}/src/java"  destdir ="${classes.dir}"
		       includeantruntime="false" encoding="UTF-8">
			<classpath refid="compile.classpath"/>
		</javac>
	</target>

	<target name="deploy" depends="compile">
		<!--copy Webcontent-->
		<scp trust="true" username="${server.username}" password="${server.password}"
		     port="${server.port}" todir="${server.deploydir}">
			<fileset dir="${web.root}"/>
		</scp>

		<!--stop tomcat-->
		<sshexec host="${server.ip}" port="${server.port}" username="${server.username}"
		         password="${server.password}" command="${tomcat.home}/bin/shutdown.sh"
		         trust="true" />
		<sleep seconds="${sleep.time}" />

		<!--start tomcat-->
		<sshexec host="${server.ip}" port="${server.port}" username="${server.username}"
		         password="${server.password}" command="${tomcat.home}/bin/startup.sh"
		         trust="true" />

	</target>

</project>
					</xmp>
				</pre>
				<code>build.properties:</code>
				<pre>
					<code class="prettyprint">
build.dir=./build
classes.dir=./WebContent/WEB-INF/classes
dist.dir=./build/dist
web.root=./WebContent
web.info=./WebContent/WEB-INF/web.xml
web.lib=./WebContent/WEB-INF/lib

tomcat.home = /home/max/Desktop/tomcat
sleep.time = 10
					</code>
				</pre>
			</div>
		</div>
	</div>

</div>
<!-- /container -->


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="../scripts/ext/jquery/extends/jquery.form.js"></script>
<!--<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>-->
<script src="../scripts/ext/bootstrap/bootstrap.min.js"></script>
<!--jQuery Bootgrid -->
<script src="../scripts/ext/bootgrid/jquery.bootgrid.min.js"></script>
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-bootgrid/1.2.0/jquery.bootgrid.min.js"></script>-->
<!--Multi Select-->
<script src="../scripts/ext/multiselect/bootstrap-multiselect.js"></script>
<!--PNotify-->
<script src="../scripts/ext/pnotify/pnotify.custom.min.js"></script>
<!--formValidation-->
<script src="../scripts/ext/formValidation/formValidation.min.js"></script>
<script src="../scripts/ext/formValidation/bootstrap.min.js"></script>
<!--Code Prettify-->
<script src="../scripts/ext/codeprettify/prettify.js"></script>
<!--Custom-->
<script src="../scripts/js/Constants.js"></script>
<script src="../scripts/js/utils.js"></script>
<script src="../scripts/js/views/dashboard.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../scripts/js/ie10-viewport-bug-workaround.js"></script>

</body>
</html>
